<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <style>
        .red {
            color: red;
        }
    </style>
</head>

<body>
    <div id="vue" :class="{red:true}">
        <div>
            <div>
                你好，{{name}},他的QQ号是:{{QQ}}
            </div>
            {{nihao(2020)}}
        </div>
        <!-- 属性绑定 -->
        <a v-bind:href="link">百度</a>
        <!-- <a :href="link" @click.prevent>百度111</a> -->
        <!-- <a :href="link" @click.stop >百度111</a> -->
        <a :href="link" @click.middle>百度111</a>

        <!-- 这里的v-html不能简写 -->
        <p v-html="a">
            <!-- {{a}} -->
        </p>

        <button v-on:click="QQ++">改变QQ</button>

        <button :click="name='索隆'">改变名字</button>

        <!-- 键盘事件 -->


        <br>
        <label for="">姓名</label>
        <input type="text" v-model="name">
        <br>
        <label for="">年龄</label>
        <input type="text">
        <button @click='sumbit'>提交</button>


        <button @click='red=!red'>改变样式</button>

        <!-- 双向绑定，v-model
             基本上只能用在input，textarea,selsect
        -->



    </div>
    <script src="./js/app.js"></script>
</body>

</html>